//应用Text生成工程

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class TextFactory {
  static Text getAppTextTitle(String text, [FontWeight weight, Color color]) {
    return Text(
      text,
      style: TextStyle(
          color: color == null ? Color(0xff276FA0) : color,
          fontSize: ScreenUtil().setSp(24),
          fontWeight: weight == null ? FontWeight.normal : FontWeight.bold),
    );
  }

  static Text getAppText(String text,
      [FontWeight weight, Color color, TextAlign textAlign]) {
    return Text(
      text,
      textAlign: textAlign == null ? TextAlign.left : textAlign,
      style: TextStyle(
          color: color == null ? Color(0xff276FA0) : color,
          fontSize: 20.sp,
          fontWeight: weight == null ? FontWeight.normal : FontWeight.bold),
    );
  }

//  overflow: TextOverflow.ellipsis,
//  maxLines: 2,
  static Text getAppSmallText(String text,
      [FontWeight weight, Color color, TextAlign textAlign]) {
    return Text(
      text,
      textAlign: textAlign == null ? TextAlign.left : textAlign,
      style: TextStyle(
          color: color == null ? Color(0xff276FA0) : color,
          fontSize: ScreenUtil().setSp(18),
          fontWeight: weight == null ? FontWeight.normal : FontWeight.bold),
    );
  }
}
